<?php
use think\facade\Route;

//默认主页
Route::get('/','v1.Banner/getBanner')->append(['id'=>1]);

Route::rule(':version/banner/:id', ':version.Banner/getBanner', 'GET');

Route::get(':version/theme$', ':version.Theme/getSimpleList');
Route::get(':version/theme/:id', ':version.Theme/getComplexOne');

Route::get(':version/product/by_category', ':version.Product/getAllInCategory');
Route::get(':version/product/:id', ':version.Product/getOne')->pattern(['id' => '\d+']);
Route::get(':version/product/recent', ':version.Product/getRecent');

Route::get(':version/category/all', ':version.Category/getAllCategories');

//Token
Route::post(':version/token/user', ':version.Token/getToken');

//添加or创建
Route::post(':version/address', ':version.address/createOrUpdateAddress');

//订单
Route::post(':version/order$', ':version.order/placeOrder');
Route::post(':version/order/:id', ':version.order/getDetail')->pattern(['id'=>'\d+']);
Route::post(':version/order/by_user', ':version.order/getSummaryByUser');

//支付相关
Route::post(':version/pay/pre_order', ':version.Pay/getPreOrder');

//回调路由
Route::post(':version/pay/notify',':version.Pay/receiveNotify');

//test
Route::get(':version/second', ':version.address/second');